﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public enum WeaponType {
    firearms_T,
    bomb_T
}
public interface IProp {
    void GetProp(Collider2D other2d);//获得道具时的处理方法
}

[CreateAssetMenu(menuName = "Prop/WeaponProp")]
public class WeaponProp : ScriptableObject, IProp{
    public WeaponType weaponType; //武器的类型
    public Firearms firearms;//枪械对应的Asset文件
    public Bomb_Head bomb_Head;//手雷对应的Asset文件
    public float desTime;//道具隐藏时间，一半时准备隐藏
    public float number;//增加数量
    /// <summary>
    /// 在2DTrigger中调用,不需要在外部判断
    /// </summary>
    /// <param name="other2d">获得触发的对象（2D）</param>
    public void GetProp(Collider2D other2d)
    {
        if (other2d.CompareTag("Player")) {
            if (weaponType == WeaponType.firearms_T)
            {
                //if ()//判断是否已经装备这个武器（是），根据FirearmsType
                //{
                //加弹数
                //}
                //else
                //{
                //    other2d.GetComponent<>(). = firearms;
                //重置弹数
                //}
            }
            else {
                //if ()//判断是否已经装备这个炸弹（是），根据bomb_Head.isCommon
                //{
                //加弹数
                //}
                //else
                //{
                //    other2d.GetComponent<>(). = bomb_head;
                //重置弹数
                //}
            }
        }
    }
}
